package com.zork.cmdb.webapi.mapper.cmdb;

import com.zork.cmdb.webapi.domain.dto.ModuleAttributesDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chenjh
 * @date 2018/5/15
 * @description
 */
@Mapper
public interface ModuleAttributesMapper {

    @Select("SELECT [AttributesID]\n" +
            "      ,[AttributesName]\n" +
            "      ,[ModuleID]\n" +
            "      ,[AttributesGroupID]\n" +
            "      ,[AttributesType]\n" +
            "      ,[Length]\n" +
            "      ,[Level]\n" +
            "      ,[IsRequired]\n" +
            "      ,[Islabel]\n" +
            "      ,[IsCode]\n" +
            "      ,[Issable]\n" +
            "      ,[InstanceColumnName]\n" +
            "      ,[CreateTime]\n" +
            "      ,[CreateUser]\n" +
            "      ,[RalationshipID]\n FROM [ModuleAttributes] WHERE [ModuleID] = #{moduleID} ORDER BY [Level], [AttributesID]")
    List<ModuleAttributesDTO> listAttributes(@Param("moduleID") Integer moduleID);
}
